| setTransparency {GCDkit} | R Documentation |
Sets transparency of plotting colours for selected samples. Alternatively, it just returns the hexadecimal code(s) of specified colour(s) with the desired degree of transparency.
setTransparency(which.samples=NULL,transp=NULL,alpha=NULL,
col.in="black",save=TRUE,GUI=FALSE)
which.samples |
list of samples; if NULL a dialogue is displayed |
transp |
numeric; transparency to be set |
alpha |
character; alpha value to be set (opacity) |
col.in |
numeric or character vector; colour specification(s) |
save |
logical; should be the result saved into labels$Colour? |
GUI |
logical; is the function called form within GUI? |
The transparency value has to fall between 1 (completely transparent) to 0 (opaque).
Alternatively, the so-called alpha channel can be specified, which can attain any hexadecimal number between 0 (completely transparent) to ff (opaque).
if GUI = TRUE, the samples can be selected based on combination of three searching mechanisms
(by sample name/label, range or a Boolean condition) - see selectSamples for details.
Returns (invisibly) hexadecimal codes of the colours with desired degree of transparency
If 'save=TRUE' it also assigns 'labels$Colour' producing the new, partly
transparent colour.
As a side product, plotting colours are converted to hexadecimal values, which are not easy to translate back to symbolic names.
Vojtěch Janoušek, vojtech.janousek@geology.cz
Colours by a single variable can be assigned by assignColLab,
symbols and colours by groups simultaneously by assignSymbGroup.
Uniform colours are obtained by assign1col.
Table of available plotting colours is obtained by showColours.
sampleDataset("sazava")
# Affects the colour of plotting symbols in the system (save=TRUE by default)
ee<-setTransparency(transp=0.5)
binary("SiO2","Na2O+K2O")
setTransparency(transp=0)
setTransparency(which.samples=c("Sa-1","Sa-2","Sa-3"),transp=0.5)
setTransparency(which.samples=c("Sa-1","Sa-2","Sa-3"),alpha="6a")
binary("SiO2","Na2O+K2O")
figCex(2)
# No labels assigned
setTransparency(col=2,transp=0.5,save=FALSE)
setTransparency(col=c("blue","red"),transp=0.5,save=FALSE)